/**
 * Created by chen on 2016/9/22.
 */
$(function(){
    $(window).keydown(function(event){
        if (event.keyCode == 13){
            $("#login").click();
        }
    });
    //登录
    $("#login").on('click',function(){
        var account = $("input[name=account]").val();
        var pwd = $("input[name=pwd]").val();
        var datas = {
            'account' : account,
            'pwd' : pwd
        };
        var loadColse = layer.load(2, {time: 5*1000});
        $.post(sendLoginUrl ,datas,function(data){
            layer.close(loadColse);
            if (data.status) {
                window.location.href = data.url;
            } else {
                layer.msg(data.msg,{'icon':5,'time' : 3000});
            }
        },"json");

    });
});